package com.cc.controller;

import com.cc.comm.Page;
import com.cc.entity.Book;
import com.cc.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/book")
@CrossOrigin
public class BookController {
    @Autowired
    private BookService bookService;

    @GetMapping("/page")
    public Page<Book> getBookList(String bookName,String author,Integer pageNum,Integer pageSize){
        //调用业务
        Page<Book> bookPage = bookService.getBookPage(bookName,author,pageNum,pageSize);
        //返回结果
        return bookPage;
    }

//    @GetMapping("/{id}")
//    public Book getBookById(){
//
//    }
}
